package com.hspedu.Enum;

/**
 * @version 1.0
 * @author 彪哥
 */
public class Enumeration03 {
    public static void main(String[] args) {
        System.out.println(Season2.AUTUMN);
        System.out.println(Season2.SPRING);
    }
}
//演示使用enum关键字实现枚举类
enum Season2 {


    //使用静态的属性会导致Season类加载 所以添加final 优化，
//    public static final Season2 SPRING = new Season2("春天", "温暖");
//    public static final Season2 SUMMER = new Season2("夏天", "炎热");
//    public static final Season2 AUTUMN = new Season2("秋天", "凉爽");
//    public static final Season2 WINTER = new Season2("冬天", "寒冷");

    SPRING("春天", "温暖"),SUMMER("夏天", "炎热"),AUTUMN("秋天", "凉爽"),WINTER("冬天", "寒冷");
    private String name;
    private String desc;   //描述
    private Season2(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season2{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}